import 'package:base_flutter/base_flutter.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';

import '../../viewmodel/use_request/add_use_request_view_model.dart';

class AddUseRequestPage extends BaseStatefulMvvmWidget{
  num? recordId;

  AddUseRequestPage({this.recordId});

  @override
  State<StatefulWidget> createState() => _AddUseRequestState();
  
}

class _AddUseRequestState extends BaseMvvmState<AddUseRequestViewModel,AddUseRequestPage>{
  @override
  Widget buildLoadingContentView() {
    return viewModel.contentView();
  }

  @override
  Widget buildRootView(BuildContext context, Widget loadingContentWidget) {
    return Scaffold(
      appBar: AppBar(
        title: Text("领用申请"),
      ),
      body: loadingContentWidget,
    );
  }

  @override
  AddUseRequestViewModel createViewModel() {
    return AddUseRequestViewModel(context,recordId: widget.recordId);
  }

  @override
  void onRetryClick() {
    viewModel.getDetailData();
  }
  
}